import React, {Component} from 'react';
import globalContext from '../context'

class A extends Component {
    static contextType = globalContext
    render() {
        const {userName,age} = this.context
        return (
            <div>
                <h3>我是A组件</h3>
                {
                    <div>
                        <p>userName:{userName}</p>
                        <p>age:{age}</p>
                    </div>
                }
            </div>
        );
    }
}

export default A;